package cn.com.dingtek.genius.manager.server.support;

import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

@Getter
public enum ToWebType {
    /**
     *
     */
    TRASH_CAN_WEB(1, "智慧垃圾桶Web页面"),
    CAR_PARK_WEB(2, "智慧停车Web页面"),
    SEWER_COVER_WEB(3, "智慧井盖Web页面"),
    SIGNPOST_WEB(4, "智慧指路牌Web页面");

    private int value;
    private String desc;

    ToWebType(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static Optional<ToWebType> valueOf(Integer value) {
        return Arrays.stream(ToWebType.values())
                .filter(item -> item.getValue() == value)
                .findFirst();
    }

    @Override
    public String toString() {
        return desc;
    }
}
